Skip to main content

Full text of "Arduino"

See other formats


The Arduino Controlled Laser Security System 



.1 



Make Projects 



build, hack, tweak, share, discover. 



The Arduino Controlled Laser 



Security System 

Written By: William Anderson 



TOOLS: 



Computer running Windows. Mac, or 
Linux: make sure you have the arduino 
IDE installed (1) 

USB A/B cable (1) 



PARTS: 



Small Breadboard or protoshield (1) 

10K Resistor (1) 

CdS Photoresistor (1) 

Cheapie Laser Pointer (1) 

Alligator test/jumper cable set (1) 

LED(1) 

Arduino (1) 



SUMMARY 

An arduino that runs a simple sketch can become a laser security system. The hardware is 
pretty easy. 



© Make Projects 



www.makeprojects.com 



Page 1 of 4 



The Arduino Controlled Laser Security System 



Step 1 — Make the connections 




• Use the breadboard (or protoshield) 
to connect one leg of the 
photoresistor to Analog Input 0, and 
the other leg to +5v. Then, take the 
10K resistor and connect one leg to 
GND (ground) and the other to 
Analog Input 0. Also, I wired an 
LED to Digital I/O pin 13 to show 
when the laser beam is broken. 
Hook the negative end of the LED 
to ground as well. 



Step 2 — Set up the laser 




• Remove the end cap and take out the batteries. Inside, there should be a spring, connect 
one of the alligator clips to this spring. Most laser pointers have a completed circuit when 
the end cap is on, so connect the other alligator clip to some metal on the actual metal 
housing of the laser pointer. Connect one of the alligator clips to GND, and the other to 
digital I/O pin 4. Finally, you can use tape to secure the button down, so the laser pointer 
is always on. 



© Make Projects 



www.makeprojects.com 



Page 2 of 4 



The Arduino Controlled Laser Security System 



Step 3 — The program 




• Copy and paste this into the 
IDE: 

• void setup() { pinMode(4, 
OUTPUT); pi nMode( 13, 
OUTPUT);} void loop(){ 
digitalWrite(4, HIGH); 
if(analogRead(0) < 750){ 
digitalWrite(13, HIGH); } else{ 
digitalWrite(13, LOW);}} 

• Then click upload. 



© Make Projects 



www.makeprojects.com 



Page 3 of 4 



The Arduino Controlled Laser Security System 



Step 4 — Test n' troubleshoot 




• Run the program and see how it goes! When the laser is hitting the photoresistor, the LED 
is off. When the laser isn't hitting the photoresistor, the LED is on. Troubleshooting: First 
off, you have to make sure that the laser pointer is on. If it is not, check the following: - 
That the on button really is on. -That you didn't connect the alligator clips the opposite way 
they should be. To fix this, change one from GND to Pin 4, and the other from Pin 4 to 
GND. 

• There are other things you can do to change it up a little bit. You can add a 3 volt siren 
instead of the LED or use a 3 volt wireless transmitter to make an alarm on your phone or 
whatever you want. Happy Making! 

This document was last generated on 2012-11-01 10:57:05 AM. 



© Make Projects 



www.makeprojects.com 



Page 4 of 4